{% extends "base.html" %}

{% block content %}
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title mb-0">新增质量追溯记录</h4>
                </div>
                <div class="card-body">
                    <form method="POST">
                        <div class="mb-3">
                            <label class="form-label">批次号</label>
                            <input type="text" class="form-control" name="batch_number" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">产品名称</label>
                            <input type="text" class="form-control" name="product_name" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">生产日期</label>
                            <input type="date" class="form-control" name="production_date" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">有效期</label>
                            <input type="date" class="form-control" name="expiration_date" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">生产商</label>
                            <input type="text" class="form-control" name="manufacturer" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">储存条件</label>
                            <input type="text" class="form-control" name="storage_condition">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">质量标准</label>
                            <input type="text" class="form-control" name="quality_standard">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">检验员</label>
                            <input type="text" class="form-control" name="inspector">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">检验日期</label>
                            <input type="date" class="form-control" name="inspection_date">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">检验结果</label>
                            <select class="form-select" name="inspection_result">
                                <option value="pending">待检验</option>
                                <option value="passed">合格</option>
                                <option value="failed">不合格</option>
                            </select>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">备注</label>
                            <textarea class="form-control" name="notes" rows="3"></textarea>
                        </div>
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary">提交</button>
                            <a href="{{ url_for('quality.trace_list') }}" class="btn btn-secondary">返回</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 